package com.electric.qrapp.net.rxhttp

import com.electric.qrapp.net.NetCodeEnum
import com.electric.qrapp.net.code
import com.electric.qrapp.net.msg
import com.electric.qrapp.utils.system.showToast

/**
 *@author created by WA03675
 *@date  2021-12-23 16:58
 *@des  异常工具类型
 */
class ErrorUtils {
    companion object {
        fun getError(throwable: Throwable, toast: Boolean = true) {
            if (toast) {
                showToast(msg = throwable.msg)
            }
            if (throwable.code == NetCodeEnum.TOKEN_OUT.code) {
                quit()
            }
        }

        private fun quit() {

        }
    }
}